#ifndef __LIB_AGORA_CORE_ERRORMANAGER_H__
#define __LIB_AGORA_CORE_ERRORMANAGER_H__

#include <fstream>
#include <stack>
#include "IErrorManager.h"
#include "IError.h"

namespace AgoraCore
{
	class ErrorManager : public IErrorManager
	{
	public:
		static IErrorManager*	GetErrorManager(void);
		IError*					GetError();
		void					AddError(IError* error);
		std::stack<IError*>		GetAllError();
		void					PurgeError();
		bool					HasError();
		void					SetLogFilePath(const std::string& filePath);
		const std::string&		GetLogFilePath();
		void					Log(bool activate);
		bool					LogIsActivated();
	private:
		ErrorManager(void);
		static IErrorManager*	_instance;
		std::stack<IError*>		_errorStack;
		std::string				_logFilePath;
		bool					_logActivated;
		std::filebuf			_fb;
	};
}

#endif
